package com.ww.springboot.dd.enums;

import lombok.Getter;

/**
 * 描述：
 *
 * @author 🧑‍ wanwei
 * @since 2024-10-26 09:24
 */
@Getter
public enum DealTypeEnum {

    大建云自提("1", "大建云自提"),
    ;

    private String type;
    private String desc;

    DealTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static DealTypeEnum getEnumByType(String type) {
        for (DealTypeEnum value : DealTypeEnum.values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }



    public static String format() {
        StringBuilder stringBuilder = new StringBuilder();
        for (DealTypeEnum value : DealTypeEnum.values()) {
            stringBuilder.append(value.getType()).append(":").append(value.getDesc()).append("\n");
        }
        return stringBuilder.toString();
    }
}